package org.jeecg.modules.demo.crm.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.demo.crm.annotation.FileField;
import org.jeecg.modules.demo.crm.annotation.TitleField;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 合同管理记录表
 * @Author: jeecg-boot
 * @Date:   2025-06-16
 * @Version: V1.0
 */
@Data
@TableName("c_contract")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="c_contract对象", description="合同管理记录表")
public class CContract implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
	/**合同编号*/
	@Excel(name = "合同编号", width = 15)
    @ApiModelProperty(value = "合同编号")
    private String contractNo;
	/**项目id*/
	@Excel(name = "项目id", width = 15, dictTable = "c_project_application", dicText = "project_name", dicCode = "id")
	@Dict(dictTable = "c_project_application", dicText = "project_name", dicCode = "id")
    @ApiModelProperty(value = "项目id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//空值也会修改
    private String projectId;
	/**子项目id*/
	@Excel(name = "子项目id", width = 15, dictTable = "c_sub_project", dicText = "sub_project_name", dicCode = "id")
	@Dict(dictTable = "c_sub_project", dicText = "sub_project_name", dicCode = "id")
    @ApiModelProperty(value = "子项目id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//空值也会修改
    private String subProjectId;
	/**合同金额*/
	@Excel(name = "合同金额(不含税)", width = 15)
    @ApiModelProperty(value = "合同金额(不含税)")
    private BigDecimal contractAmount;
    /**合同价是否含税价*/
    @Excel(name = "合同价是否含税价", width = 15,replace = {"是_Y","否_N"} )
    @ApiModelProperty(value = "合同价是否含税价")
    private java.lang.String taxIncluded;
    /**税率*/
    @Excel(name = "税率", width = 15)
    @ApiModelProperty(value = "税率")
    private BigDecimal taxRate;

    @Excel(name = "含税价", width = 15)
    @ApiModelProperty(value = "含税价")
    private BigDecimal taxIncludingPrice;
	/**合同日期*/
	@Excel(name = "合同日期", width = 15, format = "yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "合同日期")
    private Date contractDate;
	/**合同文件*/
	@Excel(name = "合同文件", width = 15)
    @ApiModelProperty(value = "合同文件")
    @FileField // AOP 监听文件数据，存入文件表
    private String contractFile;

    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;

    @TitleField // AOP 监听文件数据，存入文件表
    @Excel(name = "名称", width = 15)
    @ApiModelProperty(value = "名称")
    private String name;

    /**
     *
     */
    /**分包商*/
    // 提交新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "分包商")
    @Excel(name = "分包商", width = 15, dictTable = "c_contractor_info", dicText = "contact_name", dicCode = "id")
    @Dict(dictTable = "c_contractor_info", dicText = "contact_name", dicCode = "id")
    private String contactId;


    /**发包单位*/
    @TableField(exist = false)
    @Excel(name = "总包主体", width = 15, dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @Dict(dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @ApiModelProperty(value = "总包主体")
    private String companyInfoId;

    /**质保金(含税)*/
    @Excel(name = "质保金(含税)", width = 15)
    @ApiModelProperty(value = "质保金(含税)")
    private BigDecimal warrantyPrice;
    /**质保开始*/
    @Excel(name = "质保开始", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "质保开始")
    private java.util.Date warrantyTimeStart;
    /**质保结束*/
    @Excel(name = "质保结束", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "质保结束")
    private java.util.Date warrantyTimeEnd;

    /**开票id*/
    @Excel(name = "开票id", width = 15, dictTable = "c_invoice_apply", dicText = "title", dicCode = "id")
    @Dict(dictTable = "c_invoice_apply", dicText = "title", dicCode = "id")
    @ApiModelProperty(value = "开票id")
    private String invoiceApplyId;

    @Excel(name = "收票id", width = 15, dictTable = "c_payment_invoice", dicText = "invoice_number", dicCode = "id")
    @Dict(dictTable = "c_payment_invoice", dicText = "invoice_number", dicCode = "id")
    @ApiModelProperty(value = "收票id")
    private String invoiceId;

}
